// const类成员、类静态成员static示例
#include <iostream>
#include "student.h"
using namespace std;

//类外部定义静态成员
int Student::total;

//类外部定义静态方法
void Student::showtotal()
{
    cout << "学生总数" << total << endl;
}

int main()
{
    Student::showtotal();
    Student jack(1);
    jack.showinfo();

    jack.showtotal();

    Student *rose = new Student(2);
    rose->showinfo();
    Student::showtotal();
    delete rose;
    Student::showtotal();

    jack.f();

    return 0;
}